﻿

namespace LxCFD
{
    public abstract class Value1Const
    {
        public abstract class Base<T> : Value1Base<T>
        {
            public T Number { get; set; }
            public Base(T number)
            {
                this.Number = number;
            }
            public override T GetCellValue(int cellIndex)
            {
                return Number;
            }
            public override T GetFaceValue(int faceIndex)
            {
                return Number;
            }
            public override bool IsConstant()
            {
                return true;
            }
        }
        public class Double : Base<double>
        {
            public Double(double number) : base(number)
            {
            }
            public override bool IsEqual0()
            {
                return Number == 0;
            }
            public override Value1Base<double> GetCopy(HeadBase zoneOrContact)
            {
                return new Double(Number);
            }
        }
        public class Vector : Base<Vector3d>
        {
            public Vector(Vector3d number) : base(number)
            {
            }
            public override bool IsEqual0()
            {
                return Number.Is0();
            }
            public override Value1Base<Vector3d> GetCopy(HeadBase zoneOrContact)
            {
                return new Vector(Number);
            }
        }
        public static Double Double0 = new Double(0);
        public static Double Double1 = new Double(1);
        public static Vector Vector0 = new Vector(new Vector3d(0, 0, 0));
    }
}
